﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace RealState.W
{
    public partial class NewsPage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string newsID = Request.QueryString["ID"];
            ContentPlaceHolder placeHolder = Page.Form.FindControl("ContentPlaceHolder1") as ContentPlaceHolder;
            if (!string.IsNullOrEmpty(newsID))
            {
                
                Control newsDetail = LoadControl("~/uc/NewsDetail.ascx");
                placeHolder.Controls.Clear();
                placeHolder.Controls.Add(newsDetail);
            }
            else {
                Control ucListNews = LoadControl("~/uc/ucListNews.ascx");
                placeHolder.Controls.Clear();
                placeHolder.Controls.Add(ucListNews);
                
            }
           
        }
    }
}
